package com.atguigu.controller;

import com.atguigu.entity.OrderInfo;
import com.atguigu.feign.OrderFeignClient;
import com.atguigu.result.RetVal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author ：Hachimen
 * @date ：Created in 2021/9/7 14:26
 * @description：
 * @modified By：
 * @version:
 */
@Controller
public class WebPaymentController {
    @Autowired
    private OrderFeignClient orderFeignClient;

    @GetMapping("pay.html")
    public String payment(@RequestParam Long orderId, Model model){
        OrderInfo orderInfo = orderFeignClient.getOrderInfo(orderId);
        model.addAttribute("orderInfo",orderInfo);
        return "payment/pay";
    }

    //支付成功跳转页面
    @GetMapping("alipay/success.html")
    public String success(){
        return "payment/success";
    }
}
